What are the causes of foreign key and invalid object errors in your SQL script